<!--
 * @Author: Pure <305737824@qq.com>
 * @CreateTime: 2022-01-25 16:30:45
 * @LastEditors: Pure <305737824@qq.com>
 * @LastEditTime: 2022-01-27 15:50:16
 * @Description:终止表单
-->
<template>
  <el-form
    ref="form"
    label-position="right"
    label-width="128px"
    size="mini"
    :disabled="disabled"
    :model="formData"
  >
    <el-form-item label="终止原因">
      <dic-radio v-model="formData.processValue" dic-key="stopReason" type="string" />
    </el-form-item>
    <el-form-item label="详细说明">
      <el-input
        v-model="formData.remark"
        type="textarea"
        :rows="4"
      />
    </el-form-item>
  </el-form>
</template>

<script>
import DicRadio from '@/feat/system/dictionary/normal/component/dicRadio.vue';
import TicketApi from '@/feat/ticket/api';
export default {
  name: 'EndTermination',
  components: {
    DicRadio,
  },
  props: {
    disabled: {
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {
      formData: {
        processValue: '1',
        remark: null,
      },
    };
  },
  methods: {
    async onSubmit(ticketId) {
      await this.$refs.form.validate();
      await TicketApi.terminate({
        ticketId,
        ...this.formData,
      });
    },
  },
};
</script>

<style lang="scss" scoped>

</style>
